//
//  UITableViewCell+BZTheme.m
//  MZBasic
//
//  Created by Sings on 2022/9/8.
//

#import "UITableViewCell+BZTheme.h"

@implementation UITableViewCell (BZTheme)

+ (void)load {
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        Class class           = [UITableViewCell class];
        Method originalmethod = class_getInstanceMethod(class, @selector(initWithStyle:reuseIdentifier:));
        Method swizzledMethod = class_getInstanceMethod(class, @selector(initDefaultWithStyle:reuseIdentifier:));
        method_exchangeImplementations(originalmethod, swizzledMethod);
    });
}

- (instancetype) initDefaultWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [self initDefaultWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        //fix 130714
        if (!([reuseIdentifier isEqualToString:@"PrinterCell"] ||
              [reuseIdentifier isEqualToString:@"CopiesCell"])) {
            self.backgroundColor = BZTHEME_COLOR(skin_content_bg_color);
        }
//        self.contentView.backgroundColor = BZTHEME_COLOR(skin_content_bg_color);
    }
    return self;
}

@end
